package com.insea.dao.hibernate;

import java.util.List;

import com.insea.dao.FactureDao;
import com.insea.model.Facture;
import org.springframework.stereotype.Repository;

@Repository("factureDao")
public class FactureDaoHibernate extends GenericDaoHibernate<Facture, Long> implements FactureDao {

	public FactureDaoHibernate() {
		super(Facture.class);
	}

	public List getFactureByNum(String numFacture) {
		return (List) this.getHibernateTemplate().find("from Facture where numFac like '%' || ? || '%'",numFacture);
	}

	public void saveFacture(Facture facture) {
		this.getHibernateTemplate().save(facture);
	}

}
